<script lang="tsx">
import {Component, Vue,} from 'vue-property-decorator'

@Component
export default class App extends Vue {

    // 符号`!`（确定赋值断言)
    $refs!: {
        input: HTMLInputElement
    }

    mounted() {
        // 使用没有类型转换的 `input` ref。
        this.$refs.input.focus()
    }


    render() {
        console.log()
        return (
            <div>
                <input type="text" ref="input"/>
            </div>
        )
    }
}
</script>

<style scoped>
#app {
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
    margin-top: 60px;
}
</style>
